import java.io.*;

public class Test13 {
    public static void main(String[] args) throws IOException {
        String fileName = "D:\\Java\\test13.txt";

        BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));

        writer.write("Hello Java!");
        writer.newLine();
        writer.write("安徽理工大学");
        writer.newLine();
        writer.close();

        BufferedReader in = new BufferedReader(new FileReader(fileName));

        String line = in.readLine();

        while (line != null) {
            System.out.println(line);
            line = in.readLine();
        }

        in.close();
    }
}
